Release 10.1A: OpenEdge Development:
Programming Interfaces
Inferring definitions from XML data
If the temp-table or ProDataSet has no definition, and the
READ-XML()method does not specify aschema-location, and the XML document does not contain references to XML Schema,READ-XML()will attempt to construct schema from the XML data. This is known as inferring schema.If an element in the instance data contains the
"xsi:type"attribute, the field is assigned a Progress data type based on XML Schema mapping rules. See Appendix D "XML Reference of Data Type and Code Page mappings." If the element is not typed, the field will beCHARACTER. All attributes and text elements will becomeCHARACTERfields.Inferring schema for a temp-table
Suppose you have an XML document for a single temp-table, but you have no XML Schema for it. You can either call the
READ-XML()method on a temp-table handle and create a dynamic temp-table object in Progress; or, you can call theREAD-XML()method on a ProDataSet handle and create a dynamic ProDataSet object with a single temp-table buffer in Progress.For example, examine this XML document:
Using
READ-XML()on a temp-table object with this XML document will create a temp-table namedttFam, with fourCHARACTERfields:RelativeName,Relation,IncludedOnBenefitsandEmpNum.Using
READ-XML()on a ProDataSet object with this XML will create a ProDataSet namedRows, with one temp-table buffer,ttFam,with all its buffer-fields.Inferring schema for a ProDataSet
Suppose you have an XML document for a dataset, but you have no XML Schema for it. You can call the
READ-XML()method on a ProDataSet handle and create a dynamic ProDataSet object in Progress.For example, examine this XML document:
Using
READ-XML()on a ProDataSet object will create a ProDataSet namedmyDataSetwith three temp-table buffers:Department,EmployeeandFamily. TheDepartmenttemp-table has twoCHARACTERfields:DeptCodeandDeptName. TheEmployeetemp-table has sixCHARACTERfields:EmpNum,DeptCode,LastName,FirstName,AddressandCity. TheFamilytemp-table has fourCHARACTERfields:RelativeName,Relation,IncludedOnBenefits, andEmpNum.Using
READ-XML()on a temp-table object will fail, since there is more than one temp-table represented in the XML document.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |